import { Map } from "immutable";
import * as actionTypes from "./constance";

const defaultState = Map({
  lyric: [],
  commentMusic: [],
  songDetail: [],
  simiSong: [],
  simiPlaylistInfo: [],
});

const a = (state = defaultState, action) => {
  switch (action.type) {
    case actionTypes.GET_LYRIC:
      return state.set("lyric", action.lyric);
    case actionTypes.GET_COMMENTMUSIC:
      return state.set("commentMusic", action.commentMusic);
    case actionTypes.GET_SONGDETAIL:
      return state.set("songDetail", action.songDetail);
    case actionTypes.GET_SIMISONG:
      return state.set("simiSong", action.simiSong);
    case actionTypes.GET_SIMIPLAYLIST:
      return state.set("simiPlaylistInfo", action.simiPlaylistInfo);
    default:
      return state;
  }
};
export default a;
